package model

import (
	"github.com/starmotioncf/common/region"
	"github.com/starmotioncf/soutchatpkg/sms"
)

type Country struct {
	Id             int             `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
	Code           string          `json:"code" gorm:"column:code;type:char(2);notNull;default:'';uniqueIndex:idx_code;comment:ISO国家代码"`
	Area           int             `json:"area" gorm:"column:area;type:int(11);notNull;default:0;comment:区域"`
	Name           string          `json:"name" gorm:"column:name;type:varchar(100);notNull;default:'';comment:国家名称"`
	NameCn         string          `json:"name_cn" gorm:"column:name_cn;type:varchar(100);notNull;default:'';comment:中文名称"`
	Icon           string          `json:"icon" gorm:"column:icon;type:varchar(255);notNull;default:'';comment:国家图标"`
	Lang           string          `json:"lang" gorm:"column:lang;type:varchar(10);notNull;default:'';comment:默认语言"`
	Sort           int             `json:"sort" gorm:"column:sort;type:int(11);notNull;default:0;comment:排序小到大"`
	Status         uint8           `json:"status" gorm:"column:status;type:tinyint(3);notNull;default:1;comment:1启用 2禁用"`
	Currency       string          `json:"currency" gorm:"column:currency;type:varchar(10);notNull;default:'';comment:货币代码"`
	CurrencySymbol string          `json:"currency_symbol" gorm:"column:currency_symbol;type:varchar(10);notNull;default:'';comment:货币符号"`
	Hot            uint8           `json:"hot" gorm:"column:hot;type:tinyint(3);notNull;default:2;comment:1-热门 2-不热门"`
	Region         region.Region   `json:"region" gorm:"column:region;type:bigint(20) unsigned;notNull;default:0;comment:分区"`
	Song           string          `json:"song" gorm:"column:song;type:varchar(255);notNull;default:'';comment:国家歌曲"`
	SmsProvider    sms.SMSProvider `json:"sms_provider" gorm:"column:sms_provider;type:tinyint(4);notNull;default:0;comment:注册短信服务商 0不启用短信 1腾讯云 2 梦网"`
	CreateBy       int             `json:"create_by" gorm:"column:create_by;type:int(11);notNull;default:0;comment:创建者"`
	UpdateBy       int             `json:"update_by" gorm:"column:update_by;type:int(11);notNull;default:0;comment:更新者"`
	UpdatedAt      int64           `json:"updated_at" gorm:"column:updated_at;type:bigint(20);notNull;default:0;comment:更新时间"`
	CreatedAt      int64           `json:"created_at" gorm:"column:created_at;type:bigint(20);notNull;default:0;comment:创建时间"`
}

func (Country) TableName() string {
	return "country"
}
